Exchange Maven Facade icon

Exchange Maven Facade

(0 reviews)

Migrate from v1 to v2

What's new in v2?

Maven Facade v2 introduces the ability to consume REST API specifications in your Mavenized projects. In previous versions, the groupId, artifactId, and version of a REST API was used to reference the generated Mule 4 connectors.

If you have a project that used Maven Facade v1 and you included a generated connector, when upgrading to Maven Facade v2, you need to update the dependency to that connector by adding the mule-plugin- prefix to the artifactId.

Example

Consider the following example of a Mule 4 application using Maven Facade v1:

<project xmlns="http://maven.apache.org/POM/4.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
  http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>68ef9520-24e9-4cf2-b2f5-620025690913</groupId>
  <artifactId>example-application</artifactId>
  <version>1.0.0</version>

  <dependencies>
    <dependency>
      <groupId>68ef9520-24e9-4cf2-b2f5-620025690913</groupId>
      <artifactId>pega-api</artifactId>
      <version>2.0.5</version>
      <classifier>mule-plugin</classifier>
    </dependency>
  </dependencies>

  <repositories>
    <repository>
      <id>Repository</id>
      <name>Exchange</name>
      <url>https://maven.anypoint.mulesoft.com/api/v1/organizations/ORGANIZATION_ID/maven</url>
    </repository>
  </repositories>
</project>

This works as is without any problems with Maven Facade v1. If you want to upgrade to Maven Facade v2, change the pom file accordingly:

<project xmlns="http://maven.apache.org/POM/4.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
  http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>68ef9520-24e9-4cf2-b2f5-620025690913</groupId>
  <artifactId>example-application</artifactId>
  <version>1.0.0</version>

  <dependencies>
    <dependency>
      <groupId>68ef9520-24e9-4cf2-b2f5-620025690913</groupId>
      <artifactId>mule-plugin-pega-api</artifactId>
      <version>2.0.5</version>
      <classifier>mule-plugin</classifier>
    </dependency>
  </dependencies>

  <repositories>
    <repository>
      <id>Repository</id>
      <name>Exchange</name>
      <url>https://maven.anypoint.mulesoft.com/api/v2/organizations/ORGANIZATION_ID/maven</url>
    </repository>
  </repositories>
</project>

Identifying a Generated connector

How do you know if a dependency in your pom is a generated connector? You can just use the groupId, artifactId, and version in Exchange to check the type of your dependency like this:

https://anypoint.mulesoft.com/exchange/:groupId/:artifactId/:version

For example, given:

<dependency>
  <groupId>68ef9520-24e9-4cf2-b2f5-620025690913</groupId>
  <artifactId>pega-api</artifactId>
  <version>2.0.5</version>
  <classifier>mule-plugin</classifier>
</dependency>

Browse to https://anypoint.mulesoft.com/exchange/68ef9520-24e9-4cf2-b2f5-620025690913/pega-api/2.0.5.

You can check the asset type here:

Only these dependencies need to be updated by adding the 'mule-plugin-' prefix in the artifactId.


Reviews